﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsForms
{
    public partial class CreateRandomSum : Form
    {
        public CreateRandomSum()
        {
            InitializeComponent();
        }

        private string Create()
        {
            //Ticks——此实例日期和时间的周期数
            //ToFileTimeUtc()——将DateTime值装换成Windows文件时间
            //GetHashCode()——此实例的哈希代码
            string val = DateTime.Now.GetHashCode().ToString() + System.Environment.TickCount;
            val = val.Substring(val.Length - 13);//从右边截取十三个字符
            return val;
        }
        private void btnCreate_Click(object sender, EventArgs e)
        {
            txtRadomSum.Text = Create();
        }
    }
}
